<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title></title>
    <%@ include file="/WEB-INF/include/commoncss.jsp"%>
    <script type="text/javascript"
            src="${ctx}/javascript/laydate/laydate.js"></script>
</head>
<body>
<article class="page-container">
    <div action="" class="form form-horizontal" id="scheduleAdd">
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-2"><span
                    class="c-red">*</span>中文国名：</label>
            <div class="formControls col-xs-8 col-sm-8">
                <input id="nation_z" name="nation_z" value="${politic.nation_z}" class="input-text" disabled/>
            </div>

        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-2"><span
                    class="c-red">*</span>现任首脑：</label>
            <div class="formControls col-xs-8 col-sm-3">
                <input type="text" name="leader" id="leader" class="input-text" value="${politic.leader}"/>
            </div>
            <label class="form-label col-xs-4 col-sm-2"><span
                    class="c-red">*</span>就任时间：</label>
            <div class="formControls col-xs-8 col-sm-3">
                <input type="text" name="office_time" id="office_time" class="input-text laydate-icon" value="${politic.office_time}"/>
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-2">宪法：</label>
            <div class="formControls col-xs-8 col-sm-3">
                <input type="text" name="constitution" id="constitution" class="input-text" value="${politic.constitution}"/>
            </div>
            <label class="form-label col-xs-4 col-sm-2">政府机关：</label>
            <div class="formControls col-xs-8 col-sm-3">
                <input type="text" name="government" id="government" class="input-text" value="${politic.government}"/>
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-2">政体：</label>
            <div class="formControls col-xs-8 col-sm-3">
                <input type="text" name="government_form" id="government_form" class="input-text" value="${politic.government_form}"/>
            </div>
            <label class="form-label col-xs-4 col-sm-2">议会：</label>
            <div class="formControls col-xs-8 col-sm-3">
                <input type="text" name="parliament" id="parliament" class="input-text" value="${politic.parliament}"/>
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-2">统计报表：</label>
            <div class="formControls col-xs-8 col-sm-3">
                <input placeholder="用逗号隔开" type="text" name="statistics" id="statistics" class="input-text" value="${politic.statistics}"/>
            </div>
            <label class="form-label col-xs-4 col-sm-2">相关文献：</label>
            <div class="formControls col-xs-8 col-sm-3">
                <input placeholder="用逗号隔开" type="text" name="conferences" id="conferences" class="input-text" value="${politic.conferences}"/>
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-2">司法机关：</label>
            <div class="formControls col-xs-8 col-sm-8">
                <input id="judiciary" name="judiciary"  value="${politic.judiciary}" class="input-text"/>
            </div>

        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-2">其他政治机构：</label>
            <div class="formControls col-xs-8 col-sm-3">
                <textarea id="political_angency" name="political_angency" cols="130" rows="5">${politic.political_angency}</textarea>
            </div>

        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-2">主要政治人物：</label>
            <div class="formControls col-xs-8 col-sm-3">
                <textarea id="political_persons" name="political_persons" cols="130" rows="5" value="" >${politic.political_persons}</textarea>
            </div>

        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-2">政党情况：</label>
            <div class="formControls col-xs-8 col-sm-3">
                <textarea id="parties" name="parties" cols="130" rows="5" value="" >${politic.parties}</textarea>
            </div>

        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-2">政治变迁：</label>
            <div class="formControls col-xs-8 col-sm-3">
                <textarea id="political_changes" name="political_changes" cols="130" rows="5" value="" >${politic.political_changes}</textarea>
            </div>

        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-2">其他政治信息：</label>
            <div class="formControls col-xs-8 col-sm-3">
                <textarea id="other_information" name="other_information" cols="130" rows="5" value="" >${politic.other_information}</textarea>
            </div>

        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-2">军事简介：</label>
            <div class="formControls col-xs-8 col-sm-3">
                <textarea id="military" name="military" cols="130" rows="5" value="" >${politic.military}</textarea>
            </div>

        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-2">
                <span class="c-red">*</span>来源：</label>
            <div class="formControls col-xs-8 col-sm-3">
                <textarea id="reference" name="reference" cols="130" rows="5" value="" >${politic.reference}</textarea>
            </div>

        </div>
        <div class="row cl">
            <div class="col-xs-8  col-xs-offset-5 ">
                <button value="${politic.country_code}" type="button" class="btn btn-success radius" onClick="update_politic(this.value)">提交</button>
                &nbsp;&nbsp;&nbsp;&nbsp;
                <button id="close" value="${politic.recoder_id}" onClick="layer_close();" class="btn btn-default radius" type="button"> 关闭</button>
            </div>
        </div>
    </div>
    <%@ include file="/WEB-INF/include/commonjs.jsp"%>
    <script type="text/javascript">//日期控件的设置和初始化
    !function(){
        laydate.skin('molv');//切换皮肤，请查看skins下面皮肤库
    }();

    //日期范围限制
    var start = {
        elem: '#office_time',
        format: 'YYYY-MM-DD',
        min: '1900-01-01 00:00:00', //设定最小日期
        max: '2099-06-16 00:00:00', //最大日期
        istime: true,
        istoday: false,
        choose: function(datas){
            end.min = datas; //开始日选好后，重置结束日的最小日期
            end.start = datas //将结束日的初始值设定为开始日
        }
    };
    laydate(start);

    </script>
    <script>
        function update_politic(value){
            var recorder=document.getElementById("close").value;
            var YHZH=parent.parent.document.getElementById("YHZH").innerText;
            if(YHZH.substring(0,3)!='001'&&YHZH.substring(0,3)!=recorder){
                layer.msg("你不能修改不是别人的内容只能查看",{icon:2,time:2000});
                return;
            }
            var conferences=document.getElementById("conferences").value;
            var statistics=document.getElementById("statistics").value;
            var leader=document.getElementById("leader").value;
            var office_time =document.getElementById("office_time").value;
            var constitution=document.getElementById("constitution").value;
            var government=document.getElementById("government").value;
            var government_form=document.getElementById("government_form").value;
            var parliament=document.getElementById("parliament").value;
            var judiciary=document.getElementById("judiciary").value;
            var political_angency=document.getElementById("political_angency").value;
            var political_persons=document.getElementById("political_persons").value;
            var parties=document.getElementById("parties").value;
            var political_changes=document.getElementById("political_changes").value;
            var other_information=document.getElementById("other_information").value;
            var military=document.getElementById("military").value;
            var reference=document.getElementById("reference").value;
            if(reference==null||reference==""||leader==null||leader==""||office_time==null||office_time==""){
                layer.msg("*为必填项",{icon:2,time:2000});
                return;
            }
            layer.confirm("确认提交吗",{btn:['确定','取消']},function(){

                var url="${ctx}/Politics/politic_update.do";
                var parameter={statistics:statistics,conferences:conferences,leader:leader,office_time:office_time,constitution:constitution,government:government
                    ,government_form:government_form,parliament:parliament,country_code:value,judiciary:judiciary
                    ,reference:reference ,political_angency:political_angency,political_persons:political_persons,
                    parties:parties,political_changes:political_changes,other_information:other_information,military:military};
                $.post(url,parameter,function(data){
                    if(data=="修改成功"){
                        layer.msg(data,{icon:1,time:2000},function(){
                            parent.location.reload(true);
                        })
                    }else{
                        layer.msg(data,{icon:2,time:2000});
                    }
                })
            })
        }

    </script>
</article>


</body>

</html>